<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      table {
        width: 800px;
        border: 1px solid black;
        border-collapse: collapse;
        margin: 100px auto;
      }
      tr,
      td {
        border: 1px solid black;
      }
    </style>
  </head>
  <body>
    <script>
      var str = '<table>'
      for (i = 1; i <= 9; i++) {
        str += '<tr>'
        for (j = 1; j <= i; j++) {
          str += `<td>${j} &times; ${i} = ${j * i}</td>`
        }
        str += '</tr>'
      }
      str += '</table>'
      document.write(str)
    </script>
  </body>
</html>
